package net.esj.basic.plugins.struts2;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.Result;
import com.opensymphony.xwork2.UnknownHandler;
import com.opensymphony.xwork2.XWorkException;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.inject.Inject;

public class MelonUnknowHandler implements UnknownHandler {

	private Configuration configuration;
	private String defaultPackage;
	
	private PackageConfig parentPackage;
	
	@Inject
	public MelonUnknowHandler( @Inject("melon.struts2.plugins.defaultPackage") String defaultPackage, @Inject Configuration configuration) {
		super();
		this.configuration = configuration;
		this.defaultPackage = defaultPackage;
		parentPackage = configuration.getPackageConfig(defaultPackage);
	}

	@Override
	public ActionConfig handleUnknownAction(String namespace, String actionName)
			throws XWorkException {
		System.out.println(namespace+"，"+actionName+"，IN UNKNOW HANDLER!");
		return null;
	}

	@Override
	public Object handleUnknownActionMethod(Object action, String methodName)
			throws NoSuchMethodException {
		System.out.println("IN UNKNOW Method!");
		return null;
	}

	@Override
	public Result handleUnknownResult(ActionContext actionContext,
			String actionName, ActionConfig actionConfig, String resultCode)
			throws XWorkException {
		System.out.println("IN UNKNOW Result!");
		return null;
	}

}
